package com.gaogao.java;

public class TestOv {
    int id;
    String name;
    public static void main(String args[]){
      TestOv t1=new TestOv();
      TestOv t2=new TestOv();
      t1.id=11;
      t2.id=11;
      t1.name="gao";
      t2.name="shan";
      System.out.println(t1.equals(t2));
    }

    @Override
    public boolean equals(Object obj) {
        if(this==obj){
            return false;
        }
        if(obj==null){
            return false;
        }
        if(this.getClass()!=obj.getClass()){
            return false;

        }
        TestOv t=(TestOv)obj;
        if(this.id!=t.id || this.name!=t.name){
            return false;
        }

        return true;
    }
}
